<% @page_title = "Cadastro :: Contato :: Federação :: Listando Federações" %>
<%= error_messages_for "federacao" %>
<fieldset class="FieldArea">
  <legend class="FieldAreaTitle">Informações das Federações</legend>
  <table class="ControlTable" width="100%" border="0">
    <tr>
      <th colspan="10">Nome</th>
      <th colspan="2">Código</th>
      <th colspan="2">Siglas</th>
      <th colspan="2">Situação</th>
      <th colspan="4" style="text-align: center;">Opções</th>
    </tr>
    <% odd = 0 %>
    <% for federacao in @federacaos %>
      <% odd = 1 - odd %>
      <tr>
        <td colspan="10" class="ControlTableRow<%= odd %>"><%= federacao.nome %></td>
        <td colspan="2" class="ControlTableRow<%= odd %>"><%= federacao.codigo %></td>
        <td colspan="2" class="ControlTableRow<%= odd %>"><%= federacao.sigla_dois_digitos %> ou <%= federacao.sigla_tres_digitos %></td>
        <td colspan="2" class="ControlTableRow<%= odd %>"><%= @situacoes.map{|situacao| situacao.nome if  situacao.codigo == federacao.situacao} %></td>
        <td colspan="4" style="text-align: right;" class="ControlTableRow<%= odd %>">
          <%= link_to image_tag("/resources/pictures/icons/sefaz/icon-22x22-show.gif", :size => '22x22', :style => 'border: 0px;', :title => 'Mostrar', :alt => 'Mostrar'), federacao %>
          <%= link_to image_tag("/resources/pictures/icons/sefaz/icon-22x22-edit_pencil.gif", :size => '22x22', :style => 'border: 0px;', :title => 'Editar', :alt => 'Editar'), edit_federacao_path(federacao) %>
          <%= link_to image_tag("/resources/pictures/icons/sefaz/icon-22x22-delete.gif", :size => '22x22', :style => 'border: 0px;', :title => 'Destruir', :alt => 'Destruir'), federacao, :confirm => 'Você tem certeza?', :method => :delete %>
        </td>
      </tr>
    <% end %>
    <tr>
      <td colspan="20" style="width: 100%; text-align: right;">
         <%= paginar @federacaos %>
      </td>
    </tr>
  </table>
</fieldset>
<%= submit_tag "Nova", {:class => 'CommandButton IconNew', :type => 'button', :onclick => "javascript: location.href='/federacaos/new'" } %>
<%= submit_tag "Cancelar", {:class => 'CommandButton IconCancel', :type => 'button', :onclick => "javascript: location.href='/'" } %>